/**
  ******************************************************************************
  * @file           : irkey.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */
#include <stdio.h>
#include "gui_form.h"
#include "tskcfg.h"

volatile GUI_FormStru const *gui_form_current = &gui_from_main;

uint32_t gui_mainmenu_refresh_time = 250;
const uint32_t gui_maxdelay_refresh_time = portMAX_DELAY;

void gui_form_exec(const GUI_FormStru *frm, uint8_t nowpage, uint8_t nowfocus)
{
	if(frm != NULL)
	{
		gui_form_current = frm;
		
		if(gui_form_current->load != NULL)
		{
			gui_form_current->load(nowpage, nowfocus);
		}
	}
}

void gui_form_common_home(void)
{
	gui_form_exec(&gui_from_main, 0, 0);
}

void gui_form_common_set(void)
{
  gui_form_exec(&gui_from_settmenu, 0, 0);
}

void gui_form_common_enter(void)
{
	gui_form_exec(&gui_from_calimenu, 0, 0);
}
